package com.excilys.validator;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import com.excilys.annotation.TestAnnotation;

/**
 * Validator for the IsDouble annotation
 * 
 * @author GF
 * 
 */
public class TestAnnotationValidator implements ConstraintValidator<TestAnnotation, Double> {

	@Override
	public void initialize(TestAnnotation constraintAnnotation) {
	}

	@Override
	public boolean isValid(Double transferAmount, ConstraintValidatorContext context) {

		if (transferAmount > 1000)
			return false;

		return true;
	}
}